package com.lm.integration.controller;

import com.lm.integration.inter.MyGateway;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/integration")
public class IntegrationController {

    private final MyGateway gateway;

    public IntegrationController(MyGateway gateway) {
        this.gateway = gateway;
    }

    @PostMapping("/send")
    public String sendMessage(@RequestParam String msg) {
        gateway.sendToIntegrationFlow(msg);
        return "消息已发送: " + msg;
    }
}